package com.yxc.plan.wolf.domain.repository;

import com.yxc.plan.wolf.domain.Tweet;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;

/**
 * @Description :
 * @Author : abc@vanke.com
 * @Date : 2018/12/11 4:38 PM
 */
@Repository
public interface TweetRepository extends JpaRepository<Tweet, Long>, JpaSpecificationExecutor<Tweet> {

    Page<Tweet> findByDeletedAndProjectId(Boolean deleted, Long projectId, Pageable pageable);

    Tweet findByDeletedAndId(Boolean deleted, Long id);

    List<Tweet> findByDeletedAndProjectIdAndDetailContaining(Boolean deleted, Long projectId, String key);

    Page<Tweet> findByDeletedAndProjectIdAndCommentCount(Boolean deleted, Long projectId, Long commentCount, Pageable pageable);

}
